import { HttpException } from '@nestjs/common'
import { CoreExceptionType } from './core.exception'
import { SmsExceptionType } from './sms.exception'
import { UserExceptionType } from './user.exception'
import { OaExceptionType } from './oa.exception'

export { CoreExceptionType, SmsExceptionType, UserExceptionType, OaExceptionType }

export class CoreException extends HttpException {
    constructor(ex: any) {
        const [code, message] = ex.split(':')
        super(message || '未知错误', Number(code || -1))
    }
}
